import request from '@/utils/request';
import { AxiosPromise } from 'axios';
import { SkDailiShengqingVO, SkDailiShengqingForm, SkDailiShengqingQuery } from '@/api/app/SkDailiShengqing/types';

/**
 * 查询代理申请信息列表
 * @param query
 * @returns {*}
 */

export const listSkDailiShengqing = (query?: SkDailiShengqingQuery): AxiosPromise<SkDailiShengqingVO[]> => {
  return request({
    url: '/app/SkDailiShengqing/list',
    method: 'get',
    params: query
  });
};

/**
 * 查询代理申请信息详细
 * @param id
 */
export const getSkDailiShengqing = (id: string | number): AxiosPromise<SkDailiShengqingVO> => {
  return request({
    url: '/app/SkDailiShengqing/' + id,
    method: 'get'
  });
};

/**
 * 新增代理申请信息
 * @param data
 */
export const addSkDailiShengqing = (data: SkDailiShengqingForm) => {
  return request({
    url: '/app/SkDailiShengqing',
    method: 'post',
    data: data
  });
};

/**
 * 修改代理申请信息
 * @param data
 */
export const updateSkDailiShengqing = (data: SkDailiShengqingForm) => {
  return request({
    url: '/app/SkDailiShengqing',
    method: 'put',
    data: data
  });
};

/**
 * 删除代理申请信息
 * @param id
 */
export const delSkDailiShengqing = (id: string | number | Array<string | number>) => {
  return request({
    url: '/app/SkDailiShengqing/' + id,
    method: 'delete'
  });
};
